package parttern.observer;


public class FactObservers {

    static class FactObserverA implements Observer {

        @Override
        public void update() {
            System.out.println("观察者A收到事件");
        }
    }

    static class FactObserverB implements Observer {

        @Override
        public void update() {
            System.out.println("观察者B收到事件");
        }
    }


    ///test
    public static void main(String[] args) {
        ObservableImpl observable = new ObservableImpl();
        observable.addObserver(new FactObserverA());
        observable.addObserver(new FactObserverB());
        observable.doSomething();
    }

}
